home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / tffdsply.hqx / tiff.h < prev    next >
Text File  |  1993-01-04  |  2KB  |  79 lines

  1. /*
  2.  * This software is copyright 1992 by Robert Morris.
  3.  * You may freely redistribute this software as shareware
  4.  * if you do so in the same form as you got it. If you find
  5.  * this software useful, please send $12 to:
  6.  *   Robert Morris
  7.  *   P.O. Box 1044
  8.  *   Harvard Square Station
  9.  *   Cambridge, MA 02238
  10.  *   ecognome@aol.com
  11.  * If you incorporate any of this software in any kind of
  12.  * commercial product, please send $2 per copy distributed
  13.  * to the above address.
  14.  */
  15.  
  16. #ifndef tiff_h
  17. #define tiff_h 1
  18.  
  19. /*
  20.  * this is from the TIFF 5.0 document of 8/8/88
  21.  */
  22.  
  23. /* first eight bytes of a TIFF file: */
  24. struct TIFFHeader{
  25.     short byteOrder;        /* 0x4949: little-endian; 0x4d4d: big-endian */
  26.     short versionNumber;    /* always 42 */
  27.     unsigned long offset;    /* to first Image File Directory */
  28. };
  29.  
  30. #define LittleEndian 0x4949
  31. #define BigEndian 0x4d4d
  32.  
  33. /*
  34.  * an Image File Directory has 2 bytes with the number of entries,
  35.  * then the entries, then 4 bytes of offset to the next IFD, or 0.
  36.  */
  37. struct TIFFEntry{
  38.     short tag;
  39.     short type;        /* TIFF_BYTE, TIFF_ASCII, TIFF_SHORT, TIFF_LONG, TIFF_RATIONAL */
  40.     long length;    /* really a count */
  41.     long offset;    /* offset in file, or value if <= 4 bytes */
  42. };
  43.  
  44. #define TIFF_BYTE    1    /* 8-bit unsigned integer */
  45. #define TIFF_ASCII    2    /* ascii string; last byte is null */
  46. #define TIFF_SHORT    3    /* 16 bit unsigned integer */
  47. #define TIFF_LONG    4    /* 32-bit unsigned integer */
  48. #define TIFF_RATIONAL 5    /* two longs: numerator, denominator */
  49.  
  50. /* the entry types */
  51. #define ColorMap        320
  52. #define NewSubfileType    254
  53. #define ImageWidth        256
  54. #define ImageLength        257
  55. #define BitsPerSample    258
  56. #define Compression        259
  57. #define  NoCompression    1
  58. #define  LZWCompression    5
  59. #define  PackCompression 32773
  60. #define PhotometricInterpretation    262
  61. #define  PIZeroIsWhite    0
  62. #define  PIZeroIsBlack    1
  63. #define  PIRGB            2
  64. #define  PIPalette        3
  65. #define StripOffsets    273
  66. #define SamplesPerPixel    277
  67. #define RowsPerStrip    278
  68. #define StripByteCounts    279
  69. #define XResolution        282
  70. #define YResolution        283
  71. #define PlanarConfiguration    284
  72. #define  PCContiguous    1    /* RGBRGB... */
  73. #define  PCPlanar        2    /* RR...GG...BB... */
  74. #define ResolutionUnit    296
  75. #define Predictor        317
  76. #define  NoPredictor    1
  77. #define  HDPredictor    2
  78.  
  79. #endif tiff_h